package com.kingsalert.kingsalert.bean.userinfo;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.kingsalert.kingsalert.R;

import org.json.JSONObject;

public class OthersInfo {

    private static class Inner {
        private static OthersInfo instance = new OthersInfo();
    }

    private OthersInfo(){}

    public static OthersInfo getInstance(){
        return Inner.instance;
    }

    public static void parse(JSONObject objJson){
        Inner.instance = new Gson().fromJson(objJson.toString(), OthersInfo.class);
    }

    //还款链接，获取后置空
    private String rpPath;
    //发送验证码响应参数，获取后置空
    private JSONObject sendOtpCodeJson;
    //图片上传后返回的链接，获取后置空
    private String imgPath;


    public String getRpPath() {
        if (TextUtils.isEmpty(rpPath)) return "";
        String result = rpPath;
        rpPath = "";
        return result;
    }

    public JSONObject getSendOtpCodeJson() {
        JSONObject result = sendOtpCodeJson;
        sendOtpCodeJson = null;
        return result;
    }

    public String getImgPath() {
        if (TextUtils.isEmpty(imgPath)) return "";
        String resulet = imgPath;
        imgPath = "";
        return resulet;
    }

    public void setRpPath(String rpPath) {
        this.rpPath = rpPath;
    }

    public void setSendOtpCodeJson(JSONObject sendOtpCodeJson) {
        this.sendOtpCodeJson = sendOtpCodeJson;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }
}
